import request from '../utils/request';

// 获取校友随机文章数据
export const getAlumniRandomDataService = (limit) => {
  return request.get('/alumni-events/random', {
    params: {
      limit: limit
    }
  });
};

// 根据活动id获取校友活动详情
export const getSingleAlumniEventService = (id) => {
  return request.get(`/alumni-events/${id}`)
}

// 点赞校友活动
export const likeAlumniEventService = (id) => {
  return request.post(`/alumni-events/${id}/toggle-like`)
}
//搜索资源
export const getAlumniEventSearchService = (params) => {
  return request.get('/alumni-events/search', { params })
}
// 获取用户所有发布的校友活动
export const getUserAlumniEventService = (params) => {
  return request.get('/alumni-events/user', { params })
}

// 删除校友活动
export const deleteAlumniEventService = (eventId) => {
  return request.delete(`/alumni-events/${eventId}`)
}
// POST http://localhost:8081/api/v1/alumni-events
// 创建校友活动
export const createAlumniEventService = (data) => {
  return request.post('/alumni-events', data)
}
// PUT http://localhost:8081/api/v1/alumni-events/{{eventId}}
// 更新校友活动
export const updateAlumniEventService = (eventId, data) => {
  return request.put(`/alumni-events/${eventId}`, data)
}



